Optimal. Leaf size=51 \[ -\frac {2 \cot (c+d x)}{a d}+\frac {\tanh ^{-1}(\cos (c+d x))}{a d}+\frac {\cot (c+d x)}{d (a \sin (c+d x)+a)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.08, antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {2768, 2748, 3767, 8, 3770} \[ -\frac {2 \cot (c+d x)}{a d}+\frac {\tanh ^{-1}(\cos (c+d x))}{a d}+\frac {\cot (c+d x)}{d (a \sin (c+d x)+a)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2748
Rule 2768
Rule 3767
Rule 3770
Rubi steps
\begin {align*} \int \frac {\csc ^2(c+d x)}{a+a \sin (c+d x)} \, dx &=\frac {\cot (c+d x)}{d (a+a \sin (c+d x))}-\frac {\int \csc ^2(c+d x) (-2 a+a \sin (c+d x)) \, dx}{a^2}\\ &=\frac {\cot (c+d x)}{d (a+a \sin (c+d x))}-\frac {\int \csc (c+d x) \, dx}{a}+\frac {2 \int \csc ^2(c+d x) \, dx}{a}\\ &=\frac {\tanh ^{-1}(\cos (c+d x))}{a d}+\frac {\cot (c+d x)}{d (a+a \sin (c+d x))}-\frac {2 \operatorname {Subst}(\int 1 \, dx,x,\cot (c+d x))}{a d}\\ &=\frac {\tanh ^{-1}(\cos (c+d x))}{a d}-\frac {2 \cot (c+d x)}{a d}+\frac {\cot (c+d x)}{d (a+a \sin (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.20, size = 57, normalized size = 1.12 \[ \frac {\sec (c+d x) \left (2 \sin (c+d x)-\csc (c+d x)+\sqrt {\cos ^2(c+d x)} \tanh ^{-1}\left (\sqrt {\cos ^2(c+d x)}\right )-1\right )}{a d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.46, size = 156, normalized size = 3.06 \[ \frac {4 \, \cos \left (d x + c\right )^{2} + {\left (\cos \left (d x + c\right )^{2} - {\left (\cos \left (d x + c\right ) + 1\right )} \sin \left (d x + c\right ) - 1\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - {\left (\cos \left (d x + c\right )^{2} - {\left (\cos \left (d x + c\right ) + 1\right )} \sin \left (d x + c\right ) - 1\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 2 \, {\left (2 \, \cos \left (d x + c\right ) + 1\right )} \sin \left (d x + c\right ) + 2 \, \cos \left (d x + c\right ) - 2}{2 \, {\left (a d \cos \left (d x + c\right )^{2} - a d - {\left (a d \cos \left (d x + c\right ) + a d\right )} \sin \left (d x + c\right )\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.38, size = 88, normalized size = 1.73 \[ -\frac {\frac {2 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a} - \frac {\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a} - \frac {\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 4 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )} a}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.10, size = 77, normalized size = 1.51 \[ \frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a d}-\frac {1}{2 a d \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}-\frac {2}{a d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.36, size = 112, normalized size = 2.20 \[ -\frac {\frac {\frac {5 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1}{\frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}} + \frac {2 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.27, size = 83, normalized size = 1.63 \[ \frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,a\,d}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a\,d}-\frac {5\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1}{d\,\left (2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \frac {\int \frac {\csc ^{2}{\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx}{a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________